package com.simplenix.nicasio.mb;

import com.simplenix.nicasio.misc.AppConfiguration;
import com.simplenix.nicasio.misc.AppException;
import com.simplenix.nicasio.misc.Internationalization;
import com.simplenix.nicasio.sys.SystemDef;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author fronald
 */
public class Application {

	/** Creates a new instance of Application */
	public Application() {
	}

	public String getContextPath() {
		return SystemDef.getInstance().getContextPath();
	}

	public String getAppTittle() {
		try {
			return AppConfiguration.getInstance().getAppTitle();
		} catch (FileNotFoundException ex) {
			Logger.getLogger(Application.class.getName()).log(Level.SEVERE, null, ex);
		} catch (IOException ex) {
			Logger.getLogger(Application.class.getName()).log(Level.SEVERE, null, ex);
		}
		return null;
	}

	public String getAppLogo() {
		try {
			return SystemDef.getInstance().getContextPath() + AppConfiguration.getInstance().getAppLogo();
		} catch (FileNotFoundException ex) {
			Logger.getLogger(Application.class.getName()).log(Level.SEVERE, null, ex);
		} catch (IOException ex) {
			Logger.getLogger(Application.class.getName()).log(Level.SEVERE, null, ex);
		}
		return null;
	}

	public String getCss() {
		try {
			return SystemDef.getInstance().getContextPath() + AppConfiguration.getInstance().getCss();
		} catch (FileNotFoundException ex) {
			Logger.getLogger(Application.class.getName()).log(Level.SEVERE, null, ex);
		} catch (IOException ex) {
			Logger.getLogger(Application.class.getName()).log(Level.SEVERE, null, ex);
		}
		return null;
	}

	public String getNextString() throws AppException {
		return Internationalization.getInstance().getString("next");
	}

	public String getYesString() throws AppException {
		return Internationalization.getInstance().getString("yes");
	}

	public String getNotString() throws AppException {
		return Internationalization.getInstance().getString("not");
	}

	public String getSaveString() throws AppException {
		return Internationalization.getInstance().getString("save");
	}

}
